<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const p1 = new Promise((resolve,reject)=>{
            try{
                // throw new Error('网络错误')
                setTimeout(()=>{
                    resolve('获取成功')
                })
            }catch(e){
                reject(e)
            }
        },2000)

       const p2 = p1.finally((reason)=>{
        console.log("finally", reason)

        throw new Error("f报错")
        return new Promise((resolve, reject) => {
            // resolve("f成功")
            // reject("f失败")
      })
        })
        console.log('p2',p2)
    </script>
</body>
</html>